<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<div class="app">
    <section class="layout">
        <section class="main-content col-lg-3">
            <div class="content-wrap" id="leftCenterDiv">
                <div class="wrapper" style="bottom: 50px;">
                    <ul class="nav nav-tabs">
                        <li class="active">
                            <a href="#">手术间列表</a>
                        </li>
                    </ul>
                    <section class="panel panel-default">
                        <div class="panel-body">
                            <div class="table-responsive no-border">
                                <div class="datatable-top">
                                    <div class="pull-left">
                                        <form:form id="searchForm" modelAttribute="operationRoom"
                                                   onsubmit="return loadDivForm('mainCenterDiv','searchForm','${ctx}/operation/operationRoom/applyIndex');"
                                                   method="post" class="form-inline">
                                            <label>手术时间:</label>
                                            <input id="createDate" name="createDate" htmlEscape="false" class="form-control Wdate"
                                                   data-parsley-required="true" readonly
                                                   onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"
                                                   value='<fmt:formatDate value="${operationRoom.createDate}" pattern="yyyy-MM-dd"/>'/>
                                            <br/>
                                            <div class="form-group"><label>所属手术室:</label>
                                                <sys:treeselect selectedParent="true" id="orgDeptId" name="deptId" value="${operationRoom.deptId}"  update="${not empty orgDept.id}" labelName="${operationRoom.deptName}" labelValue="${operationRoom.deptName}"
                                                                title="科室" url="/sys/orgDept/treeData" extId="${orgDept.id}" cssClass="form-control" isnull="true"/>
                                                <%--<form:select path="deptId" class="form-control" data-parsley-required="true">--%>
                                                    <%--<option value="" label=""/>--%>
                                                    <%--<c:forEach items="${list}" var="orgDept">--%>
                                                        <%--<option items="${orgDept.deptName}" itemLabel="label" itemValue="value"--%>
                                                                <%--htmlEscape="false">${orgDept.deptName}</option>--%>
                                                    <%--</c:forEach>--%>
                                                <%--</form:select>--%>
                                            </div>
                                            <br/>
                                            <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
                                        </form:form>
                                    </div>
                                </div>
                                <table id="contentTable" class="table table-bordered table-striped mg-t datatable">
                                    <thead>
                                    <tr>
                                        <th>手术室</th>
                                        <th>手术间号</th>
                                        <th>位置</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <c:forEach items="${operationRoomList}" var="operationRooms">
                                    <tr onclick=findByRoomId("${operationRooms.id}")>
                                        <td> ${operationRooms.deptName}</td>
                                        <td> ${operationRooms.roomNo}</td>
                                        <td> ${operationRooms.location}</td>
                                    </tr>
                                    </c:forEach>
                                </table>
                            </div>
                        </div>
                    </section>
                </div>
            </div>
        </section>

        <%--右侧药品规格字典列表--%>
        <section class="main-content col-lg-8">
            <div class="content-wrap" id="rigthCenterDiv">
                <ul class="nav nav-tabs">
                    <li class="active">
                        <a href="#" >手术安排列表</a>
                    </li>
                </ul>
                <section class="panel panel-default">
                    <div class="panel-body">
                        <div class="table-responsive no-border">
                            <table id="rightTable" class="table table-bordered table-striped mg-t datatable">
                                <thead>
                                <tr>
                                    <th>姓名</th>
                                    <th>门诊/住院</th>
                                    <th>申请时间</th>
                                    <th>手术时间</th>
                                    <th>开单医生</th>
                                    <th>开单科室</th>
                                </tr>
                                </thead>
                                <tbody>
                            </table>
                        </div>
                    </div>
                </section>
            </div>
        </section>
    </section>
</div>
<script type="text/javascript">
    function findByRoomId(roomId){
        var operationTime=$('#createDate').val();
        loadDiv('rigthCenterDiv','${ctx}/operation/operationSchedule/findByRoomNo?id='+roomId+'roomId&scheduledDate='+operationTime);
    }
</script>